package com.wtwd.campus.h5_manager.service.impl;

import com.wtwd.campus.h5_manager.common.Constant;
import com.wtwd.campus.h5_manager.entity.H5ManageUser;
import com.wtwd.campus.h5_manager.service.H5AuthService;
import com.wtwd.campus.h5_manager.service.H5ManagerUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author mjy
 * @date 2022/03/08
 * @description
 */
@Service
public class H5AuthServiceImpl implements H5AuthService {

    @Autowired
    private H5ManagerUserService userService;

    @Override
    public Boolean authUserIsHq(Integer userId) {
        H5ManageUser user = userService.getUserById(userId);
        if (user==null){
            return false;
        }
        if (user.getCustomerId().equals(Constant.H5_MANAGE_CUSTOMER_ADMIN)){
            return true;
        }
        return false;
    }
}
